import Cookies from "js-cookie";

const TokenKey = "access-token";

export function getAccessToken() {
  return getToken("access_token");
  // return localStorage.getItem("access_token");

  // return Cookies.get("access_token");
}
export function getRefreshToken() {
  return getToken("refresh_token");

  // return Cookies.get("refresh_token");
}

export function getToken(key) {
  try {
    const token = localStorage.getItem(key);
    return token;
  } catch (e) {
    console.log(e);
    return null;
  }
}
export function setToken(token, key) {
  localStorage.setItem(key, token);
  // return Cookies.set(key, token);
}

export function removeToken(key) {
  return localStorage.removeItem(key);
  // return Cookies.remove(key);
}
